package com.crm.system.controller.customerManager;

import com.crm.common.model.DataResponse;
import com.crm.common.model.DhPageInfo;
import com.crm.common.model.DhResponse;
import com.crm.common.model.Enum.ResponseCodeEnum;
import com.crm.model.qo.customerManager.CustomerReturnQO;
import com.crm.model.qo.customerManager.MoveCustomerQO;
import com.crm.model.vo.customerManager.*;
import com.crm.system.service.customerManager.CustomerReturnService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * @ Author ：chaifuyou
 * @ Date   ：2021/04/23 14:12
 */
@RestController
@RequestMapping("/customerReturnController")
@Slf4j
public class CustomerReturnController {

    @Autowired
    CustomerReturnService customerReturnService;


    /**
     * 系统收回客户记录
     * @Author chaifuyou
     * @Date 2021/04/23
     * @param pageIndex 页码
     * @param pageSize 分页大小
     * @param sortName 排序列名字
     * @param sortOrder 排序规则(asc/desc)
     * @param moveCustomerQO 筛选条件
     * @return
     */
    @GetMapping("/getSysCustomerReturnList")
    public DataResponse getSysCustomerReturnList(HttpServletRequest request,
                                                @RequestParam(value = "pageIndex", required = true) Integer pageIndex,//页码
                                                @RequestParam(value = "pageSize", required = true) Integer pageSize,//分页大小
                                                @RequestParam(value="sortName",required = false) String sortName,//排序列名字
                                                @RequestParam(value="sortOrder",required = false) String sortOrder,//排序规则(asc/desc
                                                CustomerReturnQO moveCustomerQO){
        DhPageInfo<CustomerReturnVO> list = customerReturnService.getSysCustomerReturnList(pageIndex,pageSize,moveCustomerQO,sortName,sortOrder);
        return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
    }



}
